#include <bits/stdc++.h>
using namespace std;
signed main() {

  long long X;
  cin >> X;
  long long cur = 1;
  for (int i = 1;; i++) {
    cur *= i;
    if (cur == X) {
      cout << i << endl;
      return 0;
    }
  }

  return 0;
}